""" 查询标签库列表 """
from tool_class.tools import generate_random_string

tag_library_query_01 = {
    "pull_checked.标签类型": {
        "testId":"library-10001",
        "liId" : "library-10001-0"
        },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.标签类型列表": {
        "testId":"library-list-20001-t1",
        }
}
tag_library_query_02 = {
    "pull_checked.能源类型": {
        "testId":"library-10003",
        "liId" : "library-10003-0"
        },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.能源类型列表": {
        "testId":"library-list-20001-t5",
        }
}
tag_library_query_03 = {
    "pull_checked.启用状态": {
        "testId":"library-10004",
        "liId" : "library-10004-0"
        },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.启用状态列表": {
        "testId":"library-list-20001-t7",
        }
}
tag_library_query_04 = {
    "input.标签名称": {
        "testId":"library-10005",
        "value" : "不匹配标签名称"
        },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.数据源列表": {
        "testId":"library-list-20001-t2",
        }
}
tag_library_query_05 = {
    "input.标签名称": {
        "testId":"library-10005",
        "value" : "故障"
        },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.标签名称列表": {
        "testId":"library-list-20001-t2",
        }
}
tag_library_query_10 = {
    "pull_checked.标签类型": {
        "testId":"library-10001",
        "liId" : "library-10001-0"
        },
    "pull_cascade.所属分类": {
        "testId":"library-10002",
        "title_lsit" : ["智能化体验>click","智能座舱>click","仪表>checked"]
    },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.所属分类列表": {
        "testId":"library-list-20001-t3",
        }
}

""" 组合查询标签库列表 """
tag_library_query_06 = {
    "input.标签名称": {
        "testId":"library-10005",
        "value" : "故障"
        },
    "pull_checked.启用状态": {
        "testId": "library-10004",
        "liId": "library-10004-0"
    },
    "pull_checked.能源类型": {
        "testId": "library-10003",
        "liId": "library-10003-0"
    },
    "pull_checked.标签类型": {
        "testId": "library-10001",
        "liId": "library-10001-0"
    },
    "button_click.查询": {
        "testId": "library-10007",
    },
    "get_list_data.标签名称列表": {
        "testId":"library-list-20001-t2",
        },
    "get_list_data.标签类型列表": {
        "testId": "library-list-20001-t1",
    },
    "get_list_data.启用状态列表": {
        "testId": "library-list-20001-t7",
    },
    "get_list_data.能源类型列表": {
        "testId": "library-list-20001-t5",
    }
}

""" 选择标签类型时级联所属分类 """
tag_library_query_07 = {
    "element_click.所属分类": {
        "testId":"library-10002",
        }
}
tag_library_query_08 = {
    "pull_checked.标签类型": {
        "testId":"library-10001",
        "liId" : "library-10001-1"
        },
    "element_click.所属分类": {
        "testId":"library-10002",
        }
}
tag_library_query_09 = {
    "pull_checked.标签类型": {
        "testId":"library-10001",
        "liId" : "library-10001-0"
        },
    "element_click.所属分类": {
        "testId":"library-10002",
        }
}

""" 必填项验证 """
tag_library_add_01 = {
    "field_processing.标签名称必填": {
        "field_obj":{
            "所属分类": ["library-form-10004", ["售后服务>checked"]],
            "关联能源分类": [["library-form-form-item-10002-0"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}
tag_library_add_02 = {
    "field_processing.所属分类必填": {
        "field_obj":{
            "标签名称": ["library-form-10002", "测试标签"],
            "关联能源分类": [["library-form-form-item-10002-0"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}
tag_library_add_03 = {
    "field_processing.关联能源分类必填": {
        "field_obj":{
            "标签名称": ["library-form-10002", "测试标签"],
            "所属分类": ["library-form-10004", ["售后服务>checked"]],
            # "关联能源分类": [["library-form-form-item-10002-0"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}
tag_library_add_04 = {
    "field_processing.关联车辆类型必填": {
        "field_obj":{
            "标签名称": ["library-form-10002", "测试标签"],
            "所属分类": ["library-form-10004", ["售后服务>checked"]],
            "关联能源分类": [["library-form-form-item-10002-0"]],
            # "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}
tag_library_add_05 = {
    "field_processing.关联用户旅程必填": {
        "field_obj":{
            "标签名称": ["library-form-10002", "测试标签"],
            "所属分类": ["library-form-10004", ["售后服务>checked"]],
            "关联能源分类": [["library-form-form-item-10002-0"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            # "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}
tag_library_add_07 = {
    "field_processing.标签名称必填": {
        "field_obj":{
            "标签属性": ["library-form-select-type-10001", "标签分类"],
            "英文名称": ["library-form-10008", "测试标签"],
            # "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}

""" 新增编辑标签库 """
tag_library_add_06 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签类型": ["library-form-10001", "library-form-10001-1"],
            "标签名称": ["library-form-10002", generate_random_string(10)],
            "英文名称": ["library-form-10003", "test_tag"],
            "标签定义": ["library-form-10005", "测试标签"],
            "所属分类": ["library-form-10004", ["制动系统>click","制动过程>click","制动>click"]],
            "关联能源分类": [["library-form-form-item-10002-0", "library-form-form-item-10002-1"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "严重性等级": [["library-form-form-item-10007-0"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}
tag_library_edit_01 = {
    "action_bar.编辑标签": {
        "testId": "library-list-20001-b1",
        "text" : tag_library_add_06["field_processing.标签字段"]['field_obj']["标签名称"][1]
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签类型": ["library-form-10001", "library-form-10001-0"],
            "标签名称": ["library-form-10002", generate_random_string(10)],
            "所属分类": ["library-form-10004", ["销售服务>click","二手车>click","二手车相关>checked"]],
            "关联能源分类": [["library-form-form-item-10002-1", "library-form-form-item-10002-2"],"library-form-form-item-10001",True],
            # "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    },
}


""" 新增禁用的标签系统无法调用标签库 """
tag_library_add_08 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签类型": ["library-form-10001", "library-form-10001-1"],
            "标签名称": ["library-form-10002", generate_random_string(10)],
            "英文名称": ["library-form-10003", "test_tag"],
            "标签定义": ["library-form-10005", "测试标签"],
            "是否启用": ["library-form-10006", "禁用"],
            "所属分类": ["library-form-10004", ["制动系统>click","制动过程>click","制动>click"]],
            "关联能源分类": [["library-form-form-item-10002-0", "library-form-form-item-10002-1"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "严重性等级": [["library-form-form-item-10007-0"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}

""" 新增标签分类后验证标签分类是否可以被调用 """
""" 创建末级标签分类 """
tag_library_add_09 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签属性": ["library-form-select-type-10001", "标签分类"],
            "分类名称": ["library-form-10007", generate_random_string(10)],
            "所属分类": ["library-form-10009", ["销售服务>click","二手车>click","二手车相关>checked"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    },
    "button_click.再次新增标签": {
        "testId": "library-10008",
    },
    "field_processing.查看标签字段": {
        "field_obj": {
            "所属分类": ["library-form-10004", ["销售服务>click","二手车>click","二手车相关>click"]],
        }
    }
}
""" 创建一级标签分类 """
tag_library_add_10 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签属性": ["library-form-select-type-10001", "标签分类"],
            "分类名称": ["library-form-10007", generate_random_string(10)],
            # "所属分类": ["library-form-10009", ["销售服务>click","二手车>click","二手车相关>click"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    },
    "button_click.再次新增标签": {
        "testId": "library-10008",
    },
    "element_click.查看标签字段": {
        "testId": "library-form-10004",
    }
}


""" 标签名称不可重复 """
tag_library_add_11 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj": {
            "标签类型": ["library-form-10001", "library-form-10001-0"],
            "标签名称": ["library-form-10002", tag_library_edit_01['field_processing.标签字段']['field_obj']["标签名称"][1]],
            "英文名称": ["library-form-10003", "test_tag"],
            "标签定义": ["library-form-10005", "测试标签"],
            "所属分类": ["library-form-10004", ["销售服务>click","二手车>click","二手车相关>checked"]],
            "关联能源分类": [["library-form-form-item-10002-0", "library-form-form-item-10002-1"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}

tag_library_add_12 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj": {
            "标签属性": ["library-form-select-type-10001", "标签分类"],
            "分类名称": ["library-form-10007", "精品服务"],
            "所属分类": ["library-form-10009", ["销售服务>click","交付体验>checked"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}

""" 验证字段长度 """
tag_library_add_13 = {
    "input.标签名称_50":{
        "testId": "library-form-10002",
        "value": generate_random_string(51),
    }
}
tag_library_add_14 = {
    "input.英文名称_50":{
        "testId": "library-form-10003",
        "value": generate_random_string(51),
    }
}
tag_library_add_15 = {
    "input.标签定义_1024":{
        "testId": "library-form-10005",
        "value": generate_random_string(1025),
    }
}
tag_library_add_16 = {
    "radio_select.标签属性":{
        "testId": "library-form-select-type-10001",
        "radio_vaules": "标签分类",
    },
    "input.标签名称_50":{
        "testId": "library-form-10007",
        "value": generate_random_string(51),
    }
}
tag_library_add_17 = {
    "radio_select.标签属性": {
        "testId": "library-form-select-type-10001",
        "radio_vaules": "标签分类",
    },
    "input.英文名称_50":{
        "testId": "library-form-10008",
        "value": generate_random_string(51),
    }
}

""" 查询标签应用列表 """
tag_application_query_01 = {
    "pull_checked.标签类型": {
        "testId":"application-10002",
        "liId" : "application-10002-0"
        },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.标签类型列表": {
        "testId":"application-30001-t1",
        }
}
tag_application_query_02 = {
    "pull_checked.能源类型": {
        "testId":"application-10004",
        "liId" : "application-10004-0"
        },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.能源类型列表": {
        "testId":"application-30001-t5",
        }
}
tag_application_query_03 = {
    "pull_checked.启用状态": {
        "testId":"application-10005",
        "liId" : "application-10005-0"
        },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.启用状态列表": {
        "testId":"application-30001-t6",
        }
}
tag_application_query_04 = {
    "input.标签名称": {
        "testId":"application-10006",
        "value" : "不匹配标签名称"
        },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.数据源列表": {
        "testId":"application-30001-t2",
        }
}
tag_application_query_05 = {
    "input.标签名称": {
        "testId":"application-10006",
        "value" : "故障"
        },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.标签名称列表": {
        "testId":"application-30001-t2",
        }
}
tag_application_query_06 = {
    "pull_checked.标签类型": {
        "testId":"application-10002",
        "liId" : "application-10002-0"
        },
    "pull_cascade.所属分类": {
        "testId":"application-10003",
        "title_lsit" : ["智能化体验>click","智能座舱>click","迎宾系统>checked"]
    },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.所属分类列表": {
        "testId":"application-30001-t3",
        }
}

""" 组合查询标签应用列表 """
tag_application_query_07 = {
    "input.标签名称": {
        "testId":"application-10006",
        "value" : "测试标签"
        },
    "pull_checked.启用状态": {
        "testId": "application-10005",
        "liId": "application-10005-1"
    },
    "pull_checked.能源类型": {
        "testId": "application-10004",
        "liId": "application-10004-1"
    },
    "pull_checked.标签类型": {
        "testId": "application-10002",
        "liId": "application-10002-0"
    },
    "pull_cascade.所属分类": {
        "testId": "application-10003",
        "title_lsit": ["智能化体验>click", "智能座舱>click", "迎宾系统>checked"]
    },
    "button_click.查询": {
        "testId": "application-10008",
    },
    "get_list_data.标签名称列表": {
        "testId":"application-30001-t2",
        },
    "get_list_data.标签类型列表": {
        "testId": "application-30001-t1",
    },
    "get_list_data.启用状态列表": {
        "testId": "application-30001-t6",
    },
    "get_list_data.能源类型列表": {
        "testId": "application-30001-t5",
    }
}

""" 标签应用选择标签类型时级联所属分类 """
tag_application_query_08 = {
    "element_click.所属分类": {
        "testId":"application-10003",
        }
}
tag_application_query_09 = {
    "pull_checked.标签类型": {
        "testId": "application-10002",
        "liId": "application-10002-1"
    },
    "element_click.所属分类": {
        "testId":"application-10003",
        }
}
tag_application_query_10 = {
    "pull_checked.标签类型": {
        "testId": "application-10002",
        "liId": "application-10002-0"
    },
    "element_click.所属分类": {
        "testId":"application-10003",
        }
}

""" 标签应用必填项验证 """
tag_application_add_01 = {
    "field_processing.标签名称必填": {
        "field_obj":{
            "所属分类": ["application-form-10005", ["售后服务>checked"]],
            "关联能源分类": [["application-formform-item-10002-1"]],
            "关联车辆类型": [["application-formform-item-10005-0"]],
            "关联用户旅程": [["application-formform-item-10010-4"]],
        }
    }
}
tag_application_add_02 = {
    "field_processing.所属分类必填": {
        "field_obj":{
            "标签名称": ["application-form-10003", "测试标签"],
            "关联能源分类": [["application-formform-item-10002-2"]],
            "关联车辆类型": [["application-formform-item-10005-1"]],
            "关联用户旅程": [["application-formform-item-10010-2"]],
        }
    }
}
tag_application_add_03 = {
    "field_processing.关联能源分类必填": {
        "field_obj":{
            "所属分类": ["application-form-10005", ["售后服务>checked"]],
            "标签名称": ["application-form-10003", "测试标签"],
            # "关联能源分类": [["application-formform-item-10002-2"]],
            "关联车辆类型": [["application-formform-item-10005-1"]],
            "关联用户旅程": [["application-formform-item-10010-2"]],
        }
    }
}
tag_application_add_04 = {
    "field_processing.关联车辆类型必填": {
        "field_obj":{
            "所属分类": ["application-form-10005", ["售后服务>checked"]],
            "标签名称": ["application-form-10003", "测试标签"],
            "关联能源分类": [["application-formform-item-10002-2"]],
            # "关联车辆类型": [["application-formform-item-10005-1"]],
            "关联用户旅程": [["application-formform-item-10010-2"]],
        }
    }
}
tag_application_add_05 = {
    "field_processing.关联用户旅程必填": {
        "field_obj":{
            "所属分类": ["application-form-10005", ["售后服务>checked"]],
            "标签名称": ["application-form-10003", "测试标签"],
            "关联能源分类": [["application-formform-item-10002-2"]],
            "关联车辆类型": [["application-formform-item-10005-1"]],
            # "关联用户旅程": [["application-formform-item-10010-2"]],
        }
    }
}
tag_application_add_06 = {
    "field_processing.标签名称必填": {
        "field_obj":{
            "标签属性": ["application-form-select-type-10001", "标签分类"],
            "英文名称": ["application-form-10009", "测试标签"],
            # "关联用户旅程": [["library-form-form-item-10010-1"]],
        }
    }
}

""" 验证标签应用字段长度 """
tag_application_add_07 = {
    "input.标签名称_50":{
        "testId": "application-form-10003",
        "value": generate_random_string(51),
    }
}
tag_application_add_08 = {
    "input.英文名称_50":{
        "testId": "application-form-10004",
        "value": generate_random_string(51),
    }
}
tag_application_add_09 = {
    "input.标签定义_1024":{
        "testId": "application-form-10006",
        "value": generate_random_string(1025),
    }
}
tag_application_add_10 = {
    "radio_select.标签属性":{
        "testId": "application-form-select-type-10001",
        "radio_vaules": "标签分类",
    },
    "input.标签名称_50":{
        "testId": "application-form-10008",
        "value": generate_random_string(51),
    }
}
tag_application_add_11 = {
    "radio_select.标签属性": {
        "testId": "application-form-select-type-10001",
        "radio_vaules": "标签分类",
    },
    "input.英文名称_50":{
        "testId": "application-form-10009",
        "value": generate_random_string(51),
    }
}

""" 新增编辑标签应用 """
tag_application_add_12 = {
    "button_click.新增标签": {
        "testId": "application-20002",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签类型": ["application-form-10002", "application-form-10002-0"],
            "标签名称": ["application-form-10003", generate_random_string(10)],
            "英文名称": ["application-form-10004", "test_tag"],
            "标签定义": ["application-form-10006", "测试标签"],
            "所属分类": ["application-form-10005", ["权益服务>click","用车权益>click","质保权益>click"]],
            "关联能源分类": [["application-formform-item-10002-2"]],
            "关联车辆类型": [["application-formform-item-10005-1"]],
            "关联用户旅程": [["application-formform-item-10010-2"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}
tag_application_edit_01 = {
    "action_bar.编辑标签": {
        "testId": "application-30001-b1",
        "text" : tag_application_add_12["field_processing.标签字段"]['field_obj']["标签名称"][1]
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签类型": ["application-form-10002", "application-form-10002-0"],
            "标签名称": ["application-form-10003", generate_random_string(10)],
            "所属分类": ["application-form-10005", ["品牌体验>click","品牌宣传>click","宣传渠道>checked"]],
            "关联能源分类": [["application-formform-item-10002-0", "application-formform-item-10002-2"],"application-formform-item-10001",True],
            # "关联车辆类型": [["library-form-form-item-10005-1"]],
            "关联用户旅程": [["application-formform-item-10010-1"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    },
}

""" 标签应用标签名称不可重复 """
tag_application_add_13 = {
    "button_click.新增标签": {
        "testId": "application-20002",
    },
    "field_processing.标签字段": {
        "field_obj": {
            "标签类型": ["application-form-10002", "application-form-10002-0"],
            "标签名称": ["application-form-10003", "宣传规模"],
            "英文名称": ["application-form-10004", "test_tag"],
            "标签定义": ["application-form-10006", "测试标签"],
            "所属分类": ["application-form-10005", ["品牌体验>click","品牌宣传>click","宣传渠道>checked"]],
            "关联能源分类": [["application-formform-item-10002-2"]],
            "关联车辆类型": [["application-formform-item-10005-1"]],
            "关联用户旅程": [["application-formform-item-10010-2"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}

tag_application_add_14 = {
    "button_click.新增标签": {
        "testId": "application-20002",
    },
    "field_processing.标签字段": {
        "field_obj": {
            "标签属性": ["application-form-select-type-10001", "标签分类"],
            "分类名称": ["application-form-10008", "售后精品服务"],
            "所属分类": ["application-form-10010", ["售后服务>click","售后精品>checked"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}

""" 新增标签分类后验证标签分类是否可以被调用 """
""" 创建末级标签分类 """
tag_application_add_15 = {
    "button_click.新增标签": {
        "testId": "application-20002",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签属性": ["application-form-select-type-10001", "标签分类"],
            "分类名称": ["application-form-10008", generate_random_string(10)],
            "所属分类": ["application-form-10010", ["销售服务>click","二手车>click","二手车相关>checked"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    },
    "button_click.再次新增标签": {
        "testId": "application-20002",
    },
    "field_processing.查看标签字段": {
        "field_obj": {
            "所属分类": ["application-form-10005", ["销售服务>click","二手车>click","二手车相关>click"]],
        }
    }
}

""" 创建一级标签分类 """
tag_application_add_16 = {
    "button_click.新增标签": {
        "testId": "application-20002",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签属性": ["application-form-select-type-10001", "标签分类"],
            "分类名称": ["application-form-10008", generate_random_string(10)],
            # "所属分类": ["library-form-10009", ["销售服务>click","二手车>click","二手车相关>click"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    },
    "button_click.再次新增标签": {
        "testId": "application-20002",
    },
    "element_click.查看标签字段": {
        "testId": "application-form-10005",
    }
}

""" 系统调用中禁用标签 """
tag_system_call_01 = {
    "button_click.新增标签": {
        "testId": "library-10008",
    },
    "field_processing.标签字段": {
        "field_obj":{
            "标签类型": ["library-form-10001", "library-form-10001-1"],
            "标签名称": ["library-form-10002", generate_random_string(10)],
            "英文名称": ["library-form-10003", "test_tag"],
            "标签定义": ["library-form-10005", "测试标签"],
            "是否启用": ["library-form-10006", "启用"],
            "所属分类": ["library-form-10004", ["制动系统>click","制动过程>click","制动>click"]],
            "关联能源分类": [["library-form-form-item-10002-0", "library-form-form-item-10002-1"]],
            "关联车辆类型": [["library-form-form-item-10005-1"]],
            "严重性等级": [["library-form-form-item-10007-0"]],
        }
    },
    "button_click.确定": {
        "text": "确定",
    }
}